import request from './request'
var getMovieList = (type, page) => {
    return request.get(`/gateway?cityId=110100&pageNum=${page}&pageSize=10&type=${type}&k=170008`, {
        data: {
            "X-Host": "mall.film-ticket.film.list"
        }
    })
}
var getBanner = () => {
    return request.get("/gateway?type=2&cityId=110100&k=3159279", {
        data: {
            "X-Host": "mall.cfg.common-banner"
        }
    })
}
var getDetail = (id) => {
    return request.get(`/gateway?filmId=${id}&k=8883362`, {
        data: {
            "X-Host": "mall.film-ticket.film.info"
        }
    })
}
var getLocation = () => {
    return request.get("/gateway?k=" + Date.now(), {
        data: {
            "X-Host": "mall.film-ticket.city.list"
        }
    })
}
var getCinemaPrice = (id, cid) => {
    return request.get(`/gateway/?filmId=${id}&cityId=${cid}&k=6822647`, {
        data: {
            "X-Host": "mall.film-ticket.cinema.film-show-cinema"
        }
    })
}
var getCinemalist = (cityId, list) => {
    return request.post("/gateway?k=6183498", {
        "cityId": `${cityId}`,
        "cinemaIds": `${list}`
    }, {
        data: {
            "X-Host": "mall.film-ticket.cinema.batch-cinema",

        }
    })
}
var getCinemaDetail = (id) => {
    return request.get(`/gateway/?cinemaId=${id}&k=2124981`, {
        data: {
            "X-Host": "mall.film-ticket.cinema.info"
        }
    })
}
var getCinemaInfo = (cityid) => {
    return request.get(`/gateway?cityId=${cityid}&ticketFlag=1&k=2577995`, {
        data: {
            "X-Host": "mall.film-ticket.cinema.list"
        }
    })
}
var getDetailSwiper = (id) => {
    return request.get(`/gateway/?cinemaId=${id}&k=6423681`, {
        data: {
            "X-Host": "mall.film-ticket.film.cinema-show-film"
        }
    })
}
var getTimeList = (fid, cid, date) => {
    return request.get(`/gateway/?filmId=${fid}&cinemaId=${cid}&date=${date}&k=903644`, {
        data: {
            "X-Host": "mall.film-ticket.schedule.list"
        }
    })
}
var getNews = () => {
    return request.get("/gateway?actId=ElzMZU125260", {
        data: {
            "X-Host": "mall.act.static-page.info"
        }
    })
}
var getCode = (phone) => {
    return request.post('/gateway', {
        "imgCode": "",
        "imgKey": '',
        "mobile": `${phone}`,
        "type": "1"
    }, {
        data: {
            "X-Host": "mall.user.sms-code.send"
        }
    })
}
var getUser = (phone, code) => {
    return request.post('/gateway', {
        "imgCode": "",
        "imgKey": '',
        "mobile": `${phone}`,
        "smsCode": `${code}`
    }, {
        data: {
            "X-Host": "mall.user.sms-code-login"
        }
    })
}
var getSeats = (id) => {
    return request.get(`/gateway/?scheduleId=${id}&k=9185386`, {
        data: {
            "X-Host": "mall.film-ticket.schedule.info"
        }
    })
}
var getSeatslist = (id) => {
    return request.get(`/gateway/?scheduleId=${id}&k=939062`, {
        data: {
            "X-Host": "mall.film-ticket.seat.list"
        }
    })
}
export {
    getMovieList,
    getBanner,
    getDetail,
    getLocation,
    getCinemalist,
    getCinemaPrice,
    getCinemaDetail,
    getCinemaInfo,
    getDetailSwiper,
    getTimeList,
    getNews,
    getCode,
    getUser,
    getSeats,
    getSeatslist
}